#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
  printf("Before: pid:%d, ppid:%d\n", getpid(), getppid());
  pid_t id = fork();

  if(!id)
  {
    //child
    printf("child-->After: pid:%d, ppid:%d\n", getpid(), getppid());
  }
  else{
    //father
    printf("father-->After: pid:%d, ppid:%d\n", getpid(), getppid());
  }
  sleep(1);

  return 0;
}
